Conversation
| */ | ||
| public final class BankOCR { | ||
|
|
||
| private static Map<Integer, String> mapNum = new HashMap<>(); |
| final int finalFactor = 10; | ||
| final int aux = 48; | ||
| for (int i = 0; i < finalNumber; i++) { | ||
| if (i % 2 != 0) { |
There was a problem hiding this comment.
Instead of using an if else
Consider using a ternary condition.
| public int evaporator(final double content, final int evap, final int threshold) { | ||
| int days = 0; | ||
| double waste1; | ||
| double limit1 = content * threshold / 100.00; |
There was a problem hiding this comment.
Do we need this variable?
| double limit1 = content * threshold / 100.00; | ||
| double conte = content; | ||
| while (conte >= limit1) { | ||
| waste1 = conte * evap / 100.00; |
There was a problem hiding this comment.
Do we need this variable?
| * @param sentence is the word or words | ||
| * @return the word spined. | ||
| */ | ||
| public static String spinWords(final String sentence) { |
There was a problem hiding this comment.
A lot of code. :(
Try to refactor it
| public void testNewRealeasenMovieAmount() { | ||
|
|
||
| // given: | ||
| final NewRelease newRelease = new NewRelease("Logan"); |
There was a problem hiding this comment.
this should be
final Movie newRelease = new NewRelease("Logan");There was a problem hiding this comment.
Apply in all your unit tests
coding.iml
Outdated
| @@ -0,0 +1,12 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
remove this unnecessary file
Coverage 80%
Codecov Report
@@ Coverage Diff @@
## develop #19 +/- ##
============================================
+ Coverage 94.78% 95.09% +0.3%
- Complexity 138 210 +72
============================================
Files 26 39 +13
Lines 307 469 +162
Branches 50 73 +23
============================================
+ Hits 291 446 +155
- Misses 5 6 +1
- Partials 11 17 +6
Continue to review full report at Codecov.
|
Coverage 90%
| if (i % 2 != 0) { | ||
| sum += ((eanCode.charAt(i) - aux) * multiply); | ||
| } else { | ||
| sum += (eanCode.charAt(i) - aux); |
There was a problem hiding this comment.
you can use a ternary condition here
| * @param sentence is the word or words | ||
| * @return the word spined. | ||
| */ | ||
| public static String spinWords(final String sentence) { |
There was a problem hiding this comment.
please refactor this code
| * Created by Administrator on 6/28/2017. | ||
| */ | ||
| public class EvaporatorTest { | ||
| private Evaporator evaporator = new Evaporator(); |
| * Created by Administrator on 6/28/2017. | ||
| */ | ||
| public class HightesAndLowestTest { | ||
| private HightesAndLowest hightesAndLowest = new HightesAndLowest(); |
| /** | ||
| * Created by Juan Pablo on 26/03/2017. | ||
| */ | ||
| public final class BankOCR { |
There was a problem hiding this comment.
This solution is not completed
|
|
||
| for (Rental rental : rentalsCustomer) { | ||
|
|
||
| result += String.format("%s ", rental.getMovie().getTitle()); |
There was a problem hiding this comment.
@AT-03/at-03
what is wrong here?
| * @param sentence is the word or words | ||
| * @return the word reversed. | ||
| */ | ||
| public static String spinWords(final String sentence) { |
There was a problem hiding this comment.
you can still improve this method.
| String account = "021453789"; | ||
|
|
||
| // when: | ||
| String expectedResult = "ERR"; |
| String[] accountArray = BankOCR.parseScannedFigures(figureScanned); | ||
|
|
||
| // when: | ||
| String actualResult = BankOCR.accountRepresentation(accountArray); |
| * Testing an invalid account. | ||
| */ | ||
| @Test | ||
| public void verifyValidateAccountNumbersFalse() { |
There was a problem hiding this comment.
@AT-03/at-03
all your unit tests should start with the prefix test not verify
| * Initialize variables. | ||
| */ | ||
| @Before | ||
| public void initialize() { |
There was a problem hiding this comment.
@AT-03/at-03
Consider using setUp instead of initialize
| * Created by Administrator on 6/28/2017. | ||
| */ | ||
| public class MultiplesOf3And5Test { | ||
| private MultiplesOf3And5 kata = new MultiplesOf3And5(); |
There was a problem hiding this comment.
@AT-03/at-03
what is wrong here?
| int checkSum = 0; | ||
| int digit = 0; | ||
| for (int i = 0; i < code.length; i++) { | ||
| digit = (code[i]); |
There was a problem hiding this comment.
remove unnecessary parenthesis
| int digit = 0; | ||
| for (int i = 0; i < code.length; i++) { | ||
| digit = (code[i]); | ||
| checkSum += ((i + 1) % 2 == 0) ? digit * 3 : digit; |
There was a problem hiding this comment.
remove unnecessary parenthesis
| double cont = content; | ||
| double limit1 = content * threshold / 100.00; | ||
| while (cont >= limit1) { | ||
| cont = cont - cont * evap / 100.00; |
There was a problem hiding this comment.
please refactor this line of code
| public NewRelease(final String title) { | ||
| super(title); | ||
| } | ||
|
|
|
|
||
| @Override | ||
| public int calculateFrequentRenterPoints(final int daysRented) { | ||
| return 1; |
| " _ _ _ _ _ _ _ " | ||
| + " ||_||_||_||_| _"; | ||
| // when: | ||
| final Boolean actualResult = BankOCR.validateAccountNumbers(figureScanned); |
There was a problem hiding this comment.
why are using the Boolean class?
you should use the primitive boolean
| * Created by Administrator on 7/2/2017. | ||
| */ | ||
| public class RentalTest { | ||
| private Regular regular; |
| * @param account account. | ||
| * @return true or false. | ||
| */ | ||
| static boolean isLegible(final String account) { |
There was a problem hiding this comment.
you can still refactor this
Mine